#ifndef _UI_SlideBox_H_
#define _UI_SlideBox_H_

#include "ui_widget.h"


namespace ui
{


class 	UISlideBox
{
public:

	enum SLIDE_DIR
	{
		SLIDE_DIR_HOR,
		SLIDE_DIR_VER,
	};

	UISlideBox(	SLIDE_DIR SlideDir, 
				ui::UIWidget* pUIMainBox, 
				int MaxValue, 
				int CurrentValue, 
				float SingleDist,
				const math::Vec2& TopLeftCorner,
				const math::Vec2& RightBottomCorner
				);

	void						Tick(float dt);
	void						MouseButtonReleased(const math::Vec2& Pos);
	void						MouseButtonDown(const math::Vec2& Pos);
	int 						GetCurrentVal() const { return m_CurrentValue; };
	void						SetChangeCallBack(ui::UIWidget::tdgEvent CallBack) { m_ChangeCallBack = CallBack; };

protected:


	bool						m_IsMouseDown;
	bool						m_IsSliding;
	ui::UIWidget*				m_pUIMainBox;

	int							m_MaxValue;
	int							m_CurrentValue;
	float						m_SingleDist;
	SLIDE_DIR					m_SlideDir;

	int							m_CurrentSlideValue;
	math::Vec2					m_MouseDownStartPos;
	math::Vec2					m_UILastKnownPos;
	math::Vec2					m_ToSlidePos;
	math::Vec2					m_TopLeft;
	math::Vec2					m_RightBottom;	
	float						m_TimeSinceMouseDown;

	ui::UIWidget::tdgEvent		m_ChangeCallBack;
	

};

}


#endif
